from django.conf.urls import url, include
from django.contrib import admin
from rest_framework_jwt.views import obtain_jwt_token
from users import views

urlpatterns = [
    url(r'^sms_codes/(?P<mobile>1[3-9]\d{9})/$', views.SmsCodeView.as_view()),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobilesView.as_view()),
    url(r'^usernames/(?P<username>\w+)/count/$', views.UsernameView.as_view()),
    url(r'^users/$', views.UserView.as_view()),
    url(r'^authorizations/$', obtain_jwt_token),
    url(r'^user/$', views.UserDetailView.as_view()),
    url(r'^email/$', views.UserUpdateView.as_view()),
    url(r'^emails/verification/$', views.EmailVerifyView.as_view()),
    url(r'^users/(?P<pk>\d+)/password/$',views.ModifyPasswordView.as_view()),

    url(r'^accounts/(?P<username>\w+)/sms/token/$', views.CheckImage.as_view()),
    url(r'^sms_codes/$', views.SendSmsCode.as_view()),
    url(r'^accounts/(?P<username>\w+)/password/token/$', views.SMSCode.as_view()),
    url(r'^users/(?P<user_id>\d+)/password/$', views.ValidatePassword.as_view()),
    url(r'^image_codes/(?P<uuid>[0-9a-z-]+)/$', views.ImageCode.as_view()),
]
